import Field from 'winged/utils/wt-model-field'
import dateUtils from 'winged/utils/wt-time-utils'
import codeUtils from '../utils/Code.js'
import permission from 'winged/utils/wt-permission.js'
import times from '../../../Resources/utils/wt-time-utils'
export default {
	title: '患者评估表',
	name: 'service_overview',
	tableName: 'hospitalized',
	single: true,
	query: {
		method: 'DRONE',
		url: 'evaluation/consulting/get_service_compose_list',
		transfer: true,
		data:{
			"user_id" :permission.getCurrentUserId() , 
			"sc_status": "",
			"patient_id": '', 
			"doctor_user_id": "",
			"order_status": "",
			"page_index": "0" ,
			"page_size": "999" ,
			"search_key": "",
		},
		placeholder: '当前没有评估表记录',
	},
	new: {
		method: 'POST',
		url: 'doctor/patient/hospitalized',
		transfer: true,
		extraParams: [
			'case_id',
		]
	},
	update: {
		method: 'PUT',
		url: 'doctor/patient/hospitalized',
		transfer: true
	},
	delete: {
		method: 'DELETE',
		url: 'doctor/patient/hospitalized',
		transfer: true
	},
	// 定义id字段
	id_field: {
		// 用于修改、删除操作的字段名
		name: 'patient_id',
		// id字段查询结果中的tableName默认为'id'
		// tableName: 'id'
	},
	fields: [
		 {
			label: '评估表单号',
			type: Field.types.number,
			display: true,
			name: 'current_order_id',
			tableName: 'current_order_id'
		},{
			label: '评估表状态',
			type: Field.types.text,
			display: true,
			name: 'current_order_status',
			tableName: 'current_order_status_text',
			builder:function(data){
				data[this.tableName] = codeUtils.parse(data).text
			}
		},{
			label: '病种',
			type: Field.types.textarea,
			display: true,
			name: 'ill_label_name',
			tableName: 'ill_label_name'
		},{
			label: '创建时间',
			type: Field.types.date,
			display: true,
			name: 'create_date',
			tableName: 'create_date',
			builder:function(data){
				data[this.tableName] = times.format(data[this.tableName])
			}
		}
	]
};

